﻿<!--
<copyright file="RangeSlider.xaml" company="Microsoft">
//  Copyright (c) Microsoft Corporation.  All rights reserved.
</copyright>
<summary>
// RangeSlider class is a wrapper around RangeSliderBase class.
// RangeSlider styles RangeSliderBase and provides a wrapper around 
// RangeSelectionChanged event. 
</summary>
-->
    
<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:SequenceAssembler="clr-namespace:SequenceAssembler"
	mc:Ignorable="d"
	x:Class="SequenceAssembler.RangeSlider"
	d:DesignWidth="640" d:DesignHeight="480" Height="Auto">

	<UserControl.Resources>
	    <ControlTemplate TargetType="{x:Type SequenceAssembler:RangeSliderBase}" x:Key="rangeSliderTemplate">
        	<Grid>
                <Slider VerticalAlignment="Stretch" TickPlacement="Both" Maximum="100" Foreground="#FFFF6C00" SmallChange="1" Value="30" LargeChange="10" Style="{DynamicResource TestSlider}" d:LayoutOverrides="Height"/>
        		<StackPanel x:Name="PART_RangeSliderContainer">
        			<RepeatButton FocusVisualStyle="{x:Null}" x:Name="PART_LeftEdge" Background="{x:Null}" Content="click me" Style="{DynamicResource leftedgerepeatbutton}" BorderBrush="{x:Null}"/>
        			<Thumb x:Name="PART_LeftThumb" Style="{DynamicResource leftdragthumbstyle}"/><!--This size of this thumb will auto matically change by the control to 10-->
                    <!--This size of this thumb will auto matically change by the control to 1-->
        			<Thumb x:Name="PART_MiddleThumb" Background="AntiqueWhite" Cursor="ScrollWE"  MinWidth="1" Style="{DynamicResource middlethumboverlaystyle}"/>
                    <Thumb x:Name="PART_RightThumb" Style="{DynamicResource rightdragthumbstyle}"/><!--This size of this thumb will auto matically change by the control to 10-->
                    <!--This size of this thumb will auto matically change by the control to 10-->
        			<RepeatButton x:Name="PART_RightEdge" Background="AliceBlue" Content="click me" Style="{DynamicResource leftedgerepeatbutton}"/>
        		</StackPanel>
        	</Grid>
        </ControlTemplate>
        
    	<Style x:Key="ButtonFocusVisual">
    		<Setter Property="Control.Template">
    			<Setter.Value>
    				<ControlTemplate>
    					<Rectangle Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" Margin="2" SnapsToDevicePixels="true"/>
    				</ControlTemplate>
    			</Setter.Value>
    		</Setter>
    	</Style>
    	<LinearGradientBrush x:Key="ButtonNormalBackground" EndPoint="0,1" StartPoint="0,0">
    		<GradientStop Color="#F3F3F3" Offset="0"/>
    		<GradientStop Color="#EBEBEB" Offset="0.5"/>
    		<GradientStop Color="#DDDDDD" Offset="0.5"/>
    		<GradientStop Color="#CDCDCD" Offset="1"/>
    	</LinearGradientBrush>
    	<SolidColorBrush x:Key="ButtonNormalBorder" Color="#FF707070"/>
    	<Style x:Key="BaseButtonStyle" TargetType="{x:Type ButtonBase}">
    		<Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
    		<Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
    		<Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}"/>
    		<Setter Property="BorderThickness" Value="1"/>
    		<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
    		<Setter Property="HorizontalContentAlignment" Value="Center"/>
    		<Setter Property="VerticalContentAlignment" Value="Center"/>
    		<Setter Property="Padding" Value="1"/>
    		<Setter Property="Template">
    			<Setter.Value>
    				<ControlTemplate TargetType="{x:Type ButtonBase}">
    					<Rectangle Fill="#00FFFFFF" Stroke="{x:Null}"/>
    					<ControlTemplate.Triggers>
    						<Trigger Property="IsKeyboardFocused" Value="true"/>
    						<Trigger Property="ToggleButton.IsChecked" Value="true"/>
    						<Trigger Property="IsEnabled" Value="false">
    							<Setter Property="Foreground" Value="#ADADAD"/>
    						</Trigger>
    					</ControlTemplate.Triggers>
    				</ControlTemplate>
    			</Setter.Value>
    		</Setter>
    	</Style>
    	<Style x:Key="leftedgerepeatbutton" BasedOn="{StaticResource BaseButtonStyle}" TargetType="{x:Type RepeatButton}">
    		<Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/>
    	</Style>

        <Style x:Key="leftdragthumbstyle" TargetType="{x:Type Thumb}">
            <Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/>
            <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Thumb}">
                        <ControlTemplate.Resources>
                            <Storyboard x:Key="Storyboard1">
                                <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="border" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
                                    <SplineColorKeyFrame KeyTime="00:00:00.2000000" Value="#FF7EC5EC"/>
                                </ColorAnimationUsingKeyFrames>
                                <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="rectangle" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                                    <SplineColorKeyFrame KeyTime="00:00:00.2000000" Value="#FF2C7BB1"/>
                                </ColorAnimationUsingKeyFrames>
                                <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="border" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)">
                                    <SplineColorKeyFrame KeyTime="00:00:00.2000000" Value="#FF2C7BB1"/>
                                </ColorAnimationUsingKeyFrames>
                            </Storyboard>
                            <Storyboard x:Key="Storyboard2">
                                <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="border" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
                                    <SplineColorKeyFrame KeyTime="00:00:00.4000000" Value="#FFF4F4F4"/>
                                </ColorAnimationUsingKeyFrames>
                                <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="border" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)">
                                    <SplineColorKeyFrame KeyTime="00:00:00.4000000" Value="#FFA6A6A6"/>
                                </ColorAnimationUsingKeyFrames>
                                <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="rectangle" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                                    <SplineColorKeyFrame KeyTime="00:00:00.4000000" Value="#FF8B8B8B"/>
                                </ColorAnimationUsingKeyFrames>
                            </Storyboard>
                        </ControlTemplate.Resources>
                        <Grid Background="#00000000">
                            <Rectangle x:Name="rectangle" Fill="#FF8B8B8B" Stroke="{x:Null}" HorizontalAlignment="Center" Margin="0,0,0,0" Width="1"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>


        <Style x:Key="middlethumboverlaystyle" TargetType="{x:Type Thumb}">
    		<Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/>
    		<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
    		<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
    		<Setter Property="Template">
    			<Setter.Value>
    				<ControlTemplate TargetType="{x:Type Thumb}">
    					<Border Background="#33868686" CornerRadius="2,2,2,2" >
    						<Grid/>
    					</Border>
    				</ControlTemplate>
    			</Setter.Value>
    		</Setter>
    	</Style>
    	<Style x:Key="SliderRepeatButtonStyle" TargetType="{x:Type RepeatButton}">
    		<Setter Property="OverridesDefaultStyle" Value="true"/>
    		<Setter Property="IsTabStop" Value="false"/>
    		<Setter Property="Focusable" Value="false"/>
    		<Setter Property="Template">
    			<Setter.Value>
    				<ControlTemplate TargetType="{x:Type RepeatButton}">
    					<Rectangle Fill="Transparent"/>
    				</ControlTemplate>
    			</Setter.Value>
    		</Setter>
    	</Style>
    	<LinearGradientBrush x:Key="HorizontalSliderThumbHoverBackground" EndPoint="0,1" StartPoint="0,0">
    		<GradientStop Color="white" Offset="0"/>
    		<GradientStop Color="#B8E2F9" Offset="0.5"/>
    		<GradientStop Color="#B0DFF8" Offset="1"/>
    	</LinearGradientBrush>
    	<SolidColorBrush x:Key="HorizontalSliderThumbHoverBorder" Color="#3C7FB1"/>
    	<LinearGradientBrush x:Key="HorizontalSliderThumbPressedBackground" EndPoint="0,1" StartPoint="0,0">
    		<GradientStop Color="#B8E4FA" Offset="0.25"/>
    		<GradientStop Color="#5EB4E3" Offset="0.5"/>
    		<GradientStop Color="#4C8BB4" Offset="1"/>
    	</LinearGradientBrush>
    	<SolidColorBrush x:Key="HorizontalSliderThumbPressedBorder" Color="#2C628B"/>
    	<Geometry x:Key="SliderThumbDisabledGeometry">M -5,-10.5 L 5,-10.5 L 5,10.5 L -5,10.5 Z</Geometry>
    	<LinearGradientBrush x:Key="HorizontalSliderThumbNormalBackground" EndPoint="0,1" StartPoint="0,0">
    		<GradientStop Color="White" Offset="0"/>
    		<GradientStop Color="#F0EFEF" Offset="0.4"/>
    		<GradientStop Color="#D6D5D5" Offset=".8"/>
    	</LinearGradientBrush>
    	<Geometry x:Key="SliderThumbOuterBorderGeometry">M -5,-9.5 A 1 1 0 0 1 -4,-10.5 L 4,-10.5 A 1 1 0 0 1 5,-9.5 L 5,9.5 A 1 1 0 0 1 4,10.5 L -4,10.5 A 1 1 0 0 1 -5,9.5 Z</Geometry>
    	<Geometry x:Key="SliderThumbMiddleBorderGeometry">M -4,-9.5 L 4,-9.5 L 4,9.5 L -4,9.5 Z</Geometry>
    	<Style x:Key="HorizontalSliderThumbStyle" TargetType="{x:Type Thumb}">
    		<Setter Property="Focusable" Value="false"/>
    		<Setter Property="OverridesDefaultStyle" Value="true"/>
    		<Setter Property="Height" Value="22"/>
    		<Setter Property="Width" Value="11"/>
    		<Setter Property="Foreground" Value="Gray"/>
    		<Setter Property="Template">
    			<Setter.Value>
    				<ControlTemplate TargetType="{x:Type Thumb}">
    					<Canvas SnapsToDevicePixels="true">
    						<Canvas.RenderTransform>
    							<TranslateTransform X="5.5" Y="11"/>
    						</Canvas.RenderTransform>
    						<Path Fill="{StaticResource HorizontalSliderThumbNormalBackground}" x:Name="Background" Data="{StaticResource SliderThumbOuterBorderGeometry}"/>
    						<Path Stroke="White" x:Name="InnerBorder" Data="{StaticResource SliderThumbMiddleBorderGeometry}"/>
    						<Path Stroke="#FF929292" x:Name="OuterBorder" Data="{StaticResource SliderThumbOuterBorderGeometry}"/>
    					</Canvas>
    					<ControlTemplate.Triggers>
    						<Trigger Property="IsMouseOver" Value="true">
    							<Setter Property="Fill" TargetName="Background" Value="{StaticResource HorizontalSliderThumbHoverBackground}"/>
    							<Setter Property="Stroke" TargetName="OuterBorder" Value="{StaticResource HorizontalSliderThumbHoverBorder}"/>
    						</Trigger>
    						<Trigger Property="Foreground" Value="Blue">
    							<Setter Property="Fill" TargetName="Background" Value="{StaticResource HorizontalSliderThumbHoverBackground}"/>
    							<Setter Property="Stroke" TargetName="OuterBorder" Value="{StaticResource HorizontalSliderThumbHoverBorder}"/>
    						</Trigger>
    						<Trigger Property="IsDragging" Value="true">
    							<Setter Property="Fill" TargetName="Background" Value="{StaticResource HorizontalSliderThumbPressedBackground}"/>
    							<Setter Property="Stroke" TargetName="OuterBorder" Value="{StaticResource HorizontalSliderThumbPressedBorder}"/>
    						</Trigger>
    						<Trigger Property="IsEnabled" Value="false">
    							<Setter Property="Fill" TargetName="Background" Value="#FFF4F4F4"/>
    							<Setter Property="Stroke" TargetName="InnerBorder" Value="{x:Null}"/>
    							<Setter Property="Data" TargetName="OuterBorder" Value="{StaticResource SliderThumbDisabledGeometry}"/>
    							<Setter Property="Stroke" TargetName="OuterBorder" Value="#FFAEB1AF"/>
    						</Trigger>
    					</ControlTemplate.Triggers>
    				</ControlTemplate>
    			</Setter.Value>
    		</Setter>
    	</Style>
    	<LinearGradientBrush x:Key="VerticalSliderThumbHoverBackground" EndPoint="1,0" StartPoint="0,0">
    		<GradientStop Color="white" Offset="0"/>
    		<GradientStop Color="#B8E2F9" Offset="0.5"/>
    		<GradientStop Color="#B0DFF8" Offset="1"/>
    	</LinearGradientBrush>
    	<LinearGradientBrush x:Key="VerticalSliderThumbPressedBackground" EndPoint="1,0" StartPoint="0,0">
    		<GradientStop Color="#B8E4FA" Offset="0.25"/>
    		<GradientStop Color="#5EB4E3" Offset="0.5"/>
    		<GradientStop Color="#4C8BB4" Offset="1"/>
    	</LinearGradientBrush>
    	<Geometry x:Key="SliderPointedThumbDisabledGeometry">M 4.5,-8.5 L -4.5,-8.5 L -4.5,4.5 L -0.5,8.5 L 0.5,8.5 L 4.5,4.5 Z</Geometry>
    	<LinearGradientBrush x:Key="VerticalSliderThumbNormalBackground" EndPoint="1,0" StartPoint="0,0">
    		<GradientStop Color="White" Offset="0"/>
    		<GradientStop Color="#F0EFEF" Offset="0.4"/>
    		<GradientStop Color="#D6D5D5" Offset=".8"/>
    	</LinearGradientBrush>
    	<Geometry x:Key="SliderPointedThumbOuterBorderGeometry">M 4.5,-7.5 A 1 1 0 0 0 3.5,-8.5 L -3.5,-8.5 A 1 1 0 0 0 -4.5,-7.5 L -4.5,4.5 L -0.5,8.5 L 0.5,8.5 L 4.5,4.5 Z</Geometry>
    	<Geometry x:Key="SliderPointedThumbMiddleBorderGeometry">M 3.5,-7.5 L -3.5,-7.5 L -3.5,4.5 L 0,8 L 3.5,4.5 Z</Geometry>
    	<Style x:Key="VerticalSliderLeftThumbStyle" TargetType="{x:Type Thumb}">
    		<Setter Property="Focusable" Value="false"/>
    		<Setter Property="OverridesDefaultStyle" Value="true"/>
    		<Setter Property="Height" Value="10"/>
    		<Setter Property="Width" Value="18"/>
    		<Setter Property="Foreground" Value="Gray"/>
    		<Setter Property="Template">
    			<Setter.Value>
    				<ControlTemplate TargetType="{x:Type Thumb}">
    					<Canvas SnapsToDevicePixels="true">
    						<Canvas.RenderTransform>
    							<TransformGroup>
    								<TransformGroup.Children>
    									<TransformCollection>
    										<RotateTransform Angle="90"/>
    										<TranslateTransform X="9" Y="5"/>
    									</TransformCollection>
    								</TransformGroup.Children>
    							</TransformGroup>
    						</Canvas.RenderTransform>
    						<Path Fill="{StaticResource VerticalSliderThumbNormalBackground}" x:Name="Background" Data="{StaticResource SliderPointedThumbOuterBorderGeometry}"/>
    						<Path Stroke="White" StrokeThickness="1" x:Name="InnerBorder" Data="{StaticResource SliderPointedThumbMiddleBorderGeometry}"/>
    						<Path Stroke="#FF929292" StrokeThickness="1" x:Name="OuterBorder" Data="{StaticResource SliderPointedThumbOuterBorderGeometry}"/>
    					</Canvas>
    					<ControlTemplate.Triggers>
    						<Trigger Property="IsMouseOver" Value="true">
    							<Setter Property="Fill" TargetName="Background" Value="{StaticResource VerticalSliderThumbHoverBackground}"/>
    							<Setter Property="Stroke" TargetName="OuterBorder" Value="{StaticResource HorizontalSliderThumbHoverBorder}"/>
    						</Trigger>
    						<Trigger Property="Foreground" Value="Blue">
    							<Setter Property="Fill" TargetName="Background" Value="{StaticResource VerticalSliderThumbHoverBackground}"/>
    							<Setter Property="Stroke" TargetName="OuterBorder" Value="{StaticResource HorizontalSliderThumbHoverBorder}"/>
    						</Trigger>
    						<Trigger Property="IsDragging" Value="true">
    							<Setter Property="Fill" TargetName="Background" Value="{StaticResource VerticalSliderThumbPressedBackground}"/>
    							<Setter Property="Stroke" TargetName="OuterBorder" Value="{StaticResource HorizontalSliderThumbPressedBorder}"/>
    						</Trigger>
    						<Trigger Property="IsEnabled" Value="false">
    							<Setter Property="Fill" TargetName="Background" Value="#FFF4F4F4"/>
    							<Setter Property="Stroke" TargetName="InnerBorder" Value="{x:Null}"/>
    							<Setter Property="Data" TargetName="OuterBorder" Value="{StaticResource SliderPointedThumbDisabledGeometry}"/>
    							<Setter Property="Stroke" TargetName="OuterBorder" Value="#FFAEB1AF"/>
    						</Trigger>
    					</ControlTemplate.Triggers>
    				</ControlTemplate>
    			</Setter.Value>
    		</Setter>
    	</Style>
    	<LinearGradientBrush x:Key="VerticalSliderThumbHoverBackgroundInverted" EndPoint="0,0" StartPoint="1,0">
    		<GradientStop Color="white" Offset="0"/>
    		<GradientStop Color="#B8E2F9" Offset="0.5"/>
    		<GradientStop Color="#B0DFF8" Offset="1"/>
    	</LinearGradientBrush>
    	<LinearGradientBrush x:Key="VerticalSliderThumbPressedBackgroundInverted" EndPoint="0,0" StartPoint="1,0">
    		<GradientStop Color="#B8E4FA" Offset="0.25"/>
    		<GradientStop Color="#5EB4E3" Offset="0.5"/>
    		<GradientStop Color="#4C8BB4" Offset="1"/>
    	</LinearGradientBrush>
    	<LinearGradientBrush x:Key="VerticalSliderThumbNormalBackgroundInverted" EndPoint="0,0" StartPoint="1,0">
    		<GradientStop Color="White" Offset="0"/>
    		<GradientStop Color="#F0EFEF" Offset="0.4"/>
    		<GradientStop Color="#D6D5D5" Offset=".8"/>
    	</LinearGradientBrush>
    	<Style x:Key="VerticalSliderRightThumbStyle" TargetType="{x:Type Thumb}">
    		<Setter Property="Focusable" Value="false"/>
    		<Setter Property="OverridesDefaultStyle" Value="true"/>
    		<Setter Property="Height" Value="10"/>
    		<Setter Property="Width" Value="18"/>
    		<Setter Property="Foreground" Value="Gray"/>
    		<Setter Property="Template">
    			<Setter.Value>
    				<ControlTemplate TargetType="{x:Type Thumb}">
    					<Canvas SnapsToDevicePixels="true">
    						<Canvas.RenderTransform>
    							<TransformGroup>
    								<TransformGroup.Children>
    									<TransformCollection>
    										<RotateTransform Angle="-90"/>
    										<TranslateTransform X="9" Y="5"/>
    									</TransformCollection>
    								</TransformGroup.Children>
    							</TransformGroup>
    						</Canvas.RenderTransform>
    						<Path Fill="{StaticResource VerticalSliderThumbNormalBackgroundInverted}" x:Name="Background" Data="{StaticResource SliderPointedThumbOuterBorderGeometry}"/>
    						<Path Stroke="White" StrokeThickness="1" x:Name="InnerBorder" Data="{StaticResource SliderPointedThumbMiddleBorderGeometry}"/>
    						<Path Stroke="#FF929292" StrokeThickness="1" x:Name="OuterBorder" Data="{StaticResource SliderPointedThumbOuterBorderGeometry}"/>
    					</Canvas>
    					<ControlTemplate.Triggers>
    						<Trigger Property="IsMouseOver" Value="true">
    							<Setter Property="Fill" TargetName="Background" Value="{StaticResource VerticalSliderThumbHoverBackgroundInverted}"/>
    							<Setter Property="Stroke" TargetName="OuterBorder" Value="{StaticResource HorizontalSliderThumbHoverBorder}"/>
    						</Trigger>
    						<Trigger Property="Foreground" Value="Blue">
    							<Setter Property="Fill" TargetName="Background" Value="{StaticResource VerticalSliderThumbHoverBackgroundInverted}"/>
    							<Setter Property="Stroke" TargetName="OuterBorder" Value="{StaticResource HorizontalSliderThumbHoverBorder}"/>
    						</Trigger>
    						<Trigger Property="IsDragging" Value="true">
    							<Setter Property="Fill" TargetName="Background" Value="{StaticResource VerticalSliderThumbPressedBackgroundInverted}"/>
    							<Setter Property="Stroke" TargetName="OuterBorder" Value="{StaticResource HorizontalSliderThumbPressedBorder}"/>
    						</Trigger>
    						<Trigger Property="IsEnabled" Value="false">
    							<Setter Property="Fill" TargetName="Background" Value="#FFF4F4F4"/>
    							<Setter Property="Stroke" TargetName="InnerBorder" Value="{x:Null}"/>
    							<Setter Property="Data" TargetName="OuterBorder" Value="{StaticResource SliderPointedThumbDisabledGeometry}"/>
    							<Setter Property="Stroke" TargetName="OuterBorder" Value="#FFAEB1AF"/>
    						</Trigger>
    					</ControlTemplate.Triggers>
    				</ControlTemplate>
    			</Setter.Value>
    		</Setter>
    	</Style>
    	<SolidColorBrush x:Key="HorizontalSliderTrackNormalBackground" Color="#FFE7EAEA"/>
    	<LinearGradientBrush x:Key="VerticalSliderTrackNormalBorder" EndPoint="1,0" StartPoint="0,0">
    		<GradientStop Color="#FFAEB1AF" Offset="0.1"/>
    		<GradientStop Color="White" Offset=".9"/>
    	</LinearGradientBrush>
    	<Style x:Key="VerticalSliderThumbStyle" TargetType="{x:Type Thumb}">
    		<Setter Property="Focusable" Value="false"/>
    		<Setter Property="OverridesDefaultStyle" Value="true"/>
    		<Setter Property="Height" Value="11"/>
    		<Setter Property="Width" Value="22"/>
    		<Setter Property="Foreground" Value="Gray"/>
    		<Setter Property="Template">
    			<Setter.Value>
    				<ControlTemplate TargetType="{x:Type Thumb}">
    					<Canvas SnapsToDevicePixels="true">
    						<Canvas.RenderTransform>
    							<TransformGroup>
    								<TransformGroup.Children>
    									<TransformCollection>
    										<RotateTransform Angle="90"/>
    										<TranslateTransform X="11" Y="5.5"/>
    									</TransformCollection>
    								</TransformGroup.Children>
    							</TransformGroup>
    						</Canvas.RenderTransform>
    						<Path Fill="{StaticResource VerticalSliderThumbNormalBackground}" x:Name="Background" Data="{StaticResource SliderThumbOuterBorderGeometry}"/>
    						<Path Stroke="White" StrokeThickness="1" x:Name="InnerBorder" Data="{StaticResource SliderThumbMiddleBorderGeometry}"/>
    						<Path Stroke="#FF929292" StrokeThickness="1" x:Name="OuterBorder" Data="{StaticResource SliderThumbOuterBorderGeometry}"/>
    					</Canvas>
    					<ControlTemplate.Triggers>
    						<Trigger Property="IsMouseOver" Value="true">
    							<Setter Property="Fill" TargetName="Background" Value="{StaticResource VerticalSliderThumbHoverBackground}"/>
    							<Setter Property="Stroke" TargetName="OuterBorder" Value="{StaticResource HorizontalSliderThumbHoverBorder}"/>
    						</Trigger>
    						<Trigger Property="Foreground" Value="Blue">
    							<Setter Property="Fill" TargetName="Background" Value="{StaticResource VerticalSliderThumbHoverBackground}"/>
    							<Setter Property="Stroke" TargetName="OuterBorder" Value="{StaticResource HorizontalSliderThumbHoverBorder}"/>
    						</Trigger>
    						<Trigger Property="IsDragging" Value="true">
    							<Setter Property="Fill" TargetName="Background" Value="{StaticResource VerticalSliderThumbPressedBackground}"/>
    							<Setter Property="Stroke" TargetName="OuterBorder" Value="{StaticResource HorizontalSliderThumbPressedBorder}"/>
    						</Trigger>
    						<Trigger Property="IsEnabled" Value="false">
    							<Setter Property="Fill" TargetName="Background" Value="#FFF4F4F4"/>
    							<Setter Property="Stroke" TargetName="InnerBorder" Value="{x:Null}"/>
    							<Setter Property="Data" TargetName="OuterBorder" Value="{StaticResource SliderThumbDisabledGeometry}"/>
    							<Setter Property="Stroke" TargetName="OuterBorder" Value="#FFAEB1AF"/>
    						</Trigger>
    					</ControlTemplate.Triggers>
    				</ControlTemplate>
    			</Setter.Value>
    		</Setter>
    	</Style>
    	<Style x:Key="TestSlider" TargetType="{x:Type Slider}">
    		<Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/>
    		<Setter Property="Background" Value="Transparent"/>
    		<Setter Property="Foreground" Value="#FFC4C4C4"/>
    		<Setter Property="Template">
    			<Setter.Value>
    				<ControlTemplate TargetType="{x:Type Slider}">
    					<Border SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
    						<Grid>
    							<Grid.RowDefinitions>
    								<RowDefinition Height="Auto"/>
    								<RowDefinition Height="Auto" MinHeight="{TemplateBinding MinHeight}"/>
    								<RowDefinition Height="Auto"/>
    							</Grid.RowDefinitions>
    							<TickBar Margin="0,-8,0,0" x:Name="TopTick" Height="4" Visibility="Visible" Grid.Row="1" Fill="{TemplateBinding Foreground}" Placement="Top"/>
    							<TickBar Margin="0,8,0,0" x:Name="BottomTick" Height="4" Visibility="Visible" Grid.Row="1" Fill="{TemplateBinding Foreground}" Placement="Bottom"/>
    							<Border Margin="5,0" x:Name="TrackBackground" VerticalAlignment="center" Height="3" Grid.Row="1" Background="#FFFE6C00" BorderBrush="{x:Null}" BorderThickness="0,0,0,0" CornerRadius="1">
    								<Canvas Margin="-6,-1">
    									<Rectangle Fill="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" Stroke="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}" StrokeThickness="1.0" x:Name="PART_SelectionRange" Height="4.0" Visibility="Hidden"/>
    								</Canvas>
    							</Border>
    							<Track x:Name="PART_Track" IsEnabled="False" Visibility="Hidden" Grid.Row="1">
    								<Track.DecreaseRepeatButton>
    									<RepeatButton Style="{StaticResource SliderRepeatButtonStyle}" Command="{x:Static Slider.DecreaseLarge}"/>
    								</Track.DecreaseRepeatButton>
    								<Track.IncreaseRepeatButton>
    									<RepeatButton Style="{StaticResource SliderRepeatButtonStyle}" Command="{x:Static Slider.IncreaseLarge}"/>
    								</Track.IncreaseRepeatButton>
    								<Track.Thumb>
    									<Thumb x:Name="Thumb" Style="{StaticResource HorizontalSliderThumbStyle}"/>
    								</Track.Thumb>
    							</Track>
    						</Grid>
    					</Border>
    					<ControlTemplate.Triggers>
    						<Trigger Property="TickPlacement" Value="Both">
    							<Setter Property="Visibility" TargetName="TopTick" Value="Visible"/>
    							<Setter Property="Visibility" TargetName="BottomTick" Value="Visible"/>
    						</Trigger>
    					</ControlTemplate.Triggers>
    				</ControlTemplate>
    			</Setter.Value>
    		</Setter>
    		<Style.Triggers>
    			<Trigger Property="Orientation" Value="Vertical">
    				<Setter Property="Template">
    					<Setter.Value>
    						<ControlTemplate TargetType="{x:Type Slider}">
    							<Border SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
    								<Grid>
    									<Grid.ColumnDefinitions>
    										<ColumnDefinition Width="Auto"/>
    										<ColumnDefinition MinWidth="{TemplateBinding MinWidth}" Width="Auto"/>
    										<ColumnDefinition Width="Auto"/>
    									</Grid.ColumnDefinitions>
    									<TickBar x:Name="TopTick" Width="4" Visibility="Collapsed" Grid.Column="0" Fill="{TemplateBinding Foreground}" Placement="Left"/>
    									<TickBar x:Name="BottomTick" Width="4" Visibility="Collapsed" Grid.Column="2" Fill="{TemplateBinding Foreground}" Placement="Right"/>
    									<Border HorizontalAlignment="center" Margin="0,5" x:Name="TrackBackground" Width="4.0" Grid.Column="1" Background="{StaticResource HorizontalSliderTrackNormalBackground}" BorderBrush="{StaticResource VerticalSliderTrackNormalBorder}" BorderThickness="1" CornerRadius="1">
    										<Canvas Margin="-1,-6">
    											<Rectangle Fill="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" Stroke="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}" StrokeThickness="1.0" x:Name="PART_SelectionRange" Width="4.0" Visibility="Hidden"/>
    										</Canvas>
    									</Border>
    									<Track x:Name="PART_Track" Grid.Column="1">
    										<Track.Thumb>
    											<Thumb x:Name="Thumb" Style="{StaticResource VerticalSliderThumbStyle}"/>
    										</Track.Thumb>
    										<Track.IncreaseRepeatButton>
    											<RepeatButton Style="{StaticResource SliderRepeatButtonStyle}" Command="{x:Static Slider.IncreaseLarge}"/>
    										</Track.IncreaseRepeatButton>
    										<Track.DecreaseRepeatButton>
    											<RepeatButton Style="{StaticResource SliderRepeatButtonStyle}" Command="{x:Static Slider.DecreaseLarge}"/>
    										</Track.DecreaseRepeatButton>
    									</Track>
    								</Grid>
    							</Border>
    							<ControlTemplate.Triggers>
    								<Trigger Property="TickPlacement" Value="TopLeft">
    									<Setter Property="Visibility" TargetName="TopTick" Value="Visible"/>
    									<Setter Property="Style" TargetName="Thumb" Value="{StaticResource VerticalSliderLeftThumbStyle}"/>
    									<Setter Property="Margin" TargetName="TrackBackground" Value="2,5,0,5"/>
    								</Trigger>
    								<Trigger Property="TickPlacement" Value="BottomRight">
    									<Setter Property="Visibility" TargetName="BottomTick" Value="Visible"/>
    									<Setter Property="Style" TargetName="Thumb" Value="{StaticResource VerticalSliderRightThumbStyle}"/>
    									<Setter Property="Margin" TargetName="TrackBackground" Value="0,5,2,5"/>
    								</Trigger>
    								<Trigger Property="TickPlacement" Value="Both">
    									<Setter Property="Visibility" TargetName="TopTick" Value="Visible"/>
    									<Setter Property="Visibility" TargetName="BottomTick" Value="Visible"/>
    								</Trigger>
    								<Trigger Property="IsSelectionRangeEnabled" Value="true">
    									<Setter Property="Visibility" TargetName="PART_SelectionRange" Value="Visible"/>
    								</Trigger>
    								<Trigger Property="IsKeyboardFocused" Value="true">
    									<Setter Property="Foreground" TargetName="Thumb" Value="Blue"/>
    								</Trigger>
    							</ControlTemplate.Triggers>
    						</ControlTemplate>
    					</Setter.Value>
    				</Setter>
    			</Trigger>
    		</Style.Triggers>
    	</Style>

        <Style x:Key="rightdragthumbstyle" TargetType="{x:Type Thumb}">
            <Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/>
            <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Thumb}">
                        <ControlTemplate.Resources>
                            <Storyboard x:Key="Storyboard1">
                                <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="border" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
                                    <SplineColorKeyFrame KeyTime="00:00:00.2000000" Value="#FF7EC5EC"/>
                                </ColorAnimationUsingKeyFrames>
                                <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="rectangle" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                                    <SplineColorKeyFrame KeyTime="00:00:00.2000000" Value="#FF2C7BB1"/>
                                </ColorAnimationUsingKeyFrames>
                                <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="border" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)">
                                    <SplineColorKeyFrame KeyTime="00:00:00.2000000" Value="#FF2C7BB1"/>
                                </ColorAnimationUsingKeyFrames>
                            </Storyboard>
                            <Storyboard x:Key="Storyboard2">
                                <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="border" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
                                    <SplineColorKeyFrame KeyTime="00:00:00.4000000" Value="#FFF4F4F4"/>
                                </ColorAnimationUsingKeyFrames>
                                <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="border" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)">
                                    <SplineColorKeyFrame KeyTime="00:00:00.4000000" Value="#FFA6A6A6"/>
                                </ColorAnimationUsingKeyFrames>
                                <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="rectangle" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                                    <SplineColorKeyFrame KeyTime="00:00:00.4000000" Value="#FF8B8B8B"/>
                                </ColorAnimationUsingKeyFrames>
                            </Storyboard>
                        </ControlTemplate.Resources>
                        <Grid Background="#00000000">
                            <Rectangle x:Name="rectangle" Fill="#FF8B8B8B" Stroke="{x:Null}" HorizontalAlignment="Center" Margin="0,0,0,0" Width="1"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
    <DockPanel>
        <DockPanel DockPanel.Dock="Top" Grid.Row="0" HorizontalAlignment="Stretch" >            
            <Grid DockPanel.Dock="Top" MinHeight="20">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <TextBlock Margin="3,-4,0,0" Text="0" VerticalAlignment="Center" Grid.Column="0" HorizontalAlignment="Left" />
                <TextBlock Margin="3,-4,0,0" x:Name="txtMidRange" VerticalAlignment="Center" Grid.Column="1" HorizontalAlignment="Center" />
                <TextBlock Margin="3,-4,0,0" x:Name="txtEndRange" VerticalAlignment="Center" Grid.Column="2" HorizontalAlignment="Right"/>
            </Grid>
        </DockPanel>        
        <SequenceAssembler:RangeSliderBase Margin="0,5,0,0" x:Name="rangeSliderBase" Template="{StaticResource rangeSliderTemplate}"/>
	</DockPanel>
</UserControl>
